package com.group.three.mapper;


import com.group.three.pojo.Videos;
import com.group.three.pojo.dto.AddNewVideoDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xueyong
 * @since 2022-11-03
 */
@Mapper
public interface VideosMapper  {

//    List<Videos> selectListVideo(@Param("videoId") Long videoId);

    List<Videos> selectVideosAll();

    int deleteVideoId(Long videoId);

    List<Videos> searchByInput(String input);
    //根据条件查询
    List<Videos> selectListVideo(@Param("videoId") Long videoId,
                                 @Param("isEnable")Integer isEnable,
                                 @Param("videoName")String videoName);




    @Transactional
    //添加视频功能 :薛勇
    int addNewVideo(AddNewVideoDto addNewVideoDto);

    List<Videos> selectAll();
    //根据标签id查视频
    List<Videos> selectselectVideoByTagId(@Param("tagid")Long tagid,
                                          @Param("isEnable")Integer isEnable);

    //根据星星等级查视频
    List<Videos> selectVideoByStar(@Param("star") Integer star,
                                   @Param("isEnable")Integer isEnable);

    List<Videos> selectVideoByYear(@Param("onYear")String onYear,
                                   @Param("endYear")String EndYear,
                                   @Param("isEnable")Integer isEnable);

    List<Videos> selectVideoByPlay(@Param("rank")Integer rank,
                                   @Param("isEnable")Integer isEnable);

    List<Videos> selectVideoByComment(@Param("rankTwo")String rankTwo,
                                      @Param("isEnable")Integer isEnable);

    Integer updatePlayNumber(@Param("videoNum")Integer videoNum,
                             @Param("videoId") Long videoId);
}
